package com.cloudbroker.bcs.platform.dav.middle.entity;

import java.util.Date;

import com.cloudbroker.bcs.common.entity.StatusUpdatable;
import com.cloudbroker.bcs.common.util.DateTimeUtil;

/**
 * Created by wangxu13798 on 2016/7/27.
 */
public class MassMessage extends StatusUpdatable {
    private static final long serialVersionUID = 1L;

    private Long mass_message_id;

    private Long broker_id;

    private String title;

    private String description;

    private String url;

    private Integer tenant_id;

    private String send_time;

    private int success_num;

    private int refuse_num;

    private int fail_num;

    public MassMessage(){}

    public MassMessage(String title,String description,String url){
        this.success_num = 0;
        this.refuse_num = 0;
        this.fail_num = 0;
        this.title =title;
        this.description =description;
        this.url =url;
        this.send_time = DateTimeUtil.toString(new Date());
    }

    public Long getMass_message_id() {
        return mass_message_id;
    }

    public void setMass_message_id(Long mass_message_id) {
        this.mass_message_id = mass_message_id;
    }

    public Long getBroker_id() {
        return broker_id;
    }

    public void setBroker_id(Long broker_id) {
        this.broker_id = broker_id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public int getSuccess_num() {
        return success_num;
    }

    public void setSuccess_num(int success_num) {
        this.success_num = success_num;
    }

    public int getRefuse_num() {
        return refuse_num;
    }

    public void setRefuse_num(int refuse_num) {
        this.refuse_num = refuse_num;
    }

    public int getFail_num() {
        return fail_num;
    }

    public void setFail_num(int fail_num) {
        this.fail_num = fail_num;
    }

    public String getSend_time() {
        return send_time;
    }

    public void setSend_time(String send_time) {
        this.send_time = send_time;
    }

    public void addSuccessNum(){
        this.success_num++;
    }

    public void addFailNum(){
        this.fail_num++;
    }

    public void addRefuseNum(){
        this.refuse_num++;
    }

    @Override
    public Integer getTenant_id() {
        return tenant_id;
    }

    @Override
    public void setTenant_id(Integer tenant_id) {
        this.tenant_id = tenant_id;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("MassMessage{");
        sb.append("mass_message_id=").append(mass_message_id);
        sb.append(", broker_id=").append(broker_id);
        sb.append(", title='").append(title).append('\'');
        sb.append(", description='").append(description).append('\'');
        sb.append(", url='").append(url).append('\'');
        sb.append(", tenant_id=").append(tenant_id);
        sb.append(", send_time='").append(send_time).append('\'');
        sb.append(", success_num=").append(success_num);
        sb.append(", refuse_num=").append(refuse_num);
        sb.append(", fail_num=").append(fail_num);
        sb.append('}');
        return sb.toString();
    }
}
